<?php

/* @var $model \app\models\Post */
/* @var $this \yii\web\View */

use app\models\Comment;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

?>

<nav class="mui-bar mui-bar-tab">
    <section class="ui-input-wrap">
        <div class="ui-input ui-border-radius" id="commentOpenPopOver">
            <label for="textarea">写评论</label>
        </div>
        <div class="btn-group">
            <span class="ui-badge-wrap" data-href="<?= Url::to(['post/comment', 'id' => $model->id]); ?>">
                <i class="iconfont">&#xe638;</i>
                <div class="ui-badge-cornernum"><?= $model->comments; ?></div>
            </span>
            <span>
                <i id="<?= Url::to(['like', 'id' => $model->id]); ?>" class="iconfont ico-fav J-fav like<?= $isLike ? ' light' : ''; ?>"></i>
            </span>

            <span id="shareOpenPopover"><i class="iconfont">&#xe600;</i></span>
        </div>
    </section>
</nav>


<div class="mui-content">
    <div class="banner-img">
        <img src="<?= $model->thumbnail; ?>"/>
    </div>

    <div class="mui-content-padded article-box">
        <h1 class="mui-h4"><?= Html::encode($model->title); ?></h1>
        <div class="tag-row">
            <i class="iconfont">&#xe614;</i>
            <label><?= Html::encode($model->tag); ?></label>
        </div>
        <div class="fflex author-row">
            <div>
                <img src="<?= \app\utils\BaseUtils::getAvatar(); ?>"/>
                <h6 class="mui-h5">高校圈</h6>
            </div>
            <span class="time"><?= date('Y-m-d', $model->ctime); ?></span>
        </div>

        <div class="article-content" style="overflow:hidden;word-wrap: break-word;">
            <p>
                <?= $model->content; ?>
            </p>
        </div>

    </div>
</div>

<?= $this->render('/comment/save', [
        'own' => Comment::OWN_POST,
        'own_id' => $model->id,
        'ref' => Url::to(['post/comment', 'id' => $model->id])
    ]
); ?>
